package com.org.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.org.model.Orderrecord;
import com.org.mapper.OrderrecordMapper;
import com.org.service.IOrderrecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author test
 * @since 2021-06-05
 */
@Service
public class OrderrecordServiceImpl extends ServiceImpl<OrderrecordMapper, Orderrecord> implements IOrderrecordService {
    @Autowired
    private OrderrecordMapper mapper;

    @Override
    public List<Orderrecord> selectAllRecord() {
        List<Orderrecord> list = mapper.selectAll();
        return list;
    }

    @Override
    public List<Orderrecord> selectAll() {
        QueryWrapper<Orderrecord> queryWrapper = new QueryWrapper<>();
        queryWrapper.isNotNull("o_id");
        List<Orderrecord> list = mapper.selectList(queryWrapper);
        return list;
    }

    @Override
    public IPage<Orderrecord> selectAllPage(Page<Orderrecord> page) {
        return mapper.selectAllPage(page);
    }

    @Override
    public IPage<Orderrecord> selectAllPageByTime(Integer current, Integer size, LocalDateTime time) {
        return null;
    }

    @Override
    public List<Orderrecord> selectByCid(Integer cid) {
        return mapper.selectByCid(cid);
    }

    @Override
    public List<Orderrecord> selectByUid(Integer uid) {
        return mapper.selectByUid(uid);
    }

    @Override
    public IPage<Orderrecord> selectPageByUid(Page<Orderrecord> page, Integer uid) {
        return mapper.selectPageByUid(page,uid);
    }

    @Override
    public IPage<Orderrecord> selectNowPage(Page<Orderrecord> page, @Param("uId") Integer uid,
                                            @Param("dateTime") LocalDateTime dateTime) {
        return mapper.selectNowPage(page,uid,dateTime);
    }

    @Override
    public IPage<Orderrecord> selectDefaultPage(Page<Orderrecord> page, Integer uid, LocalDateTime dateTime) {
        return mapper.selectDefaultPage(page,uid,dateTime);
    }

    @Override
    public IPage<Orderrecord> selectOrdPage(Page<Orderrecord> page, Integer uid) {
        return mapper.selectOrdPage(page,uid);
    }
}
